﻿
@{
    ViewBag.Title = "attendance_records";
    Layout = "~/Views/Shared/Index.cshtml";
}

<h2>考勤记录表</h2>

@model List<YaYun.Models.attendance_records>

<table class="layui-table layui-form">
    <tr>
        <th class="emp_id_td">序号</th>
        <th class="emp_tr_t">员工编号</th>
        <th class="emp_tr_t">上班打卡时间</th>
        <th class="emp_tr_t">下班打卡时间</th>
        <th class="emp_tr_t">打卡状态</th>
        <th class="emp_tr_t">上班打卡 IP 地址</th>
        <th class="emp_tr_t">下班打卡 IP 地址</th>
        <th class="emp_tr_t">备注</th>

    </tr>
    @foreach (var item in Model)
    {
        <tr class="tr_hover">
            <td class="emp_id_td">@item.id</td>
            <td class="emp_tr_t">@item.Employee.EmployeeName</td>
            <td class="emp_tr_t">@item.check_in</td>
            <td class="emp_tr_t">@item.check_out</td>
            <td class="emp_tr_t">@item.status</td>
            <td class="emp_tr_t">@item.check_in_ip</td>
            <td class="emp_tr_t">@item.check_out_ip</td>
            <td class="emp_tr_t">@item.remark</td>
        </tr>
    }
</table>


<div class="demo-laypage-pn-show">
    @Html.ActionLink("上一页", "attendance_records", new { page = ViewBag.CurrentPage - 1 }, new { @class = "layui-btn" })
    @for (int i = 1; i <= ViewBag.TotalPages; i++)
    {
        if (i == ViewBag.CurrentPage)
        {
            @Html.Label($"{@i}", new { @class = "layui-btn layui-btn-sm layui-btn-warm" }) ;
        }
        else
        {
            @Html.ActionLink(i.ToString(), "attendance_records", new { page = i }, new { @class = "layui-btn layui-btn-primary layui-btn-sm" });
        }
    }
    @Html.ActionLink("下一页", "attendance_records", new { page = ViewBag.CurrentPage + 1 }, new { @class = "layui-btn" })
</div>